package com.june.springframework.p2p;

import javax.annotation.Resource;

import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

@Component
public class MessageConsumer {
	
	@Resource
	private JmsTemplate jmsTemplate;
	
	public void consume() {
		String text = (String) jmsTemplate.receiveAndConvert();
		System.out.println("收到的消息：" + text);
	}

}
